<?php
/**
 * Created by PhpStorm.
 * Author: 芸签cms www.yunqiancms.com
 * User: sun
 * Date: 2022/8/9
 * Time: 3:41 PM
 */
namespace app\backend\modules\common\controllers;

use app\backend\controllers\BaseController;
use app\common\models\Area;

class AreaController extends BaseController
{
    public function getProvinceList(){
        $data = Area::getProvince();
        return $this->successJson('',$data);
    }

    public function getCity()
    {
        $pid = request()->pid;
        $data = Area::getCityByParentId($pid);
        return $this->successJson('', $data);
    }

    public function getDistrict()
    {
        $pid = request()->pid;

        $data = Area::getAreaByParentId($pid);
        return $this->successJson('', $data);
    }

}